home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 13 / 013.d81 / pps #30 < prev    next >
Text File  |  2022-08-26  |  3KB  |  183 lines

  1.  
  2.   PEEKs, POKEs, & SYSes -- Part 30
  3.  
  4.       Written by Alan Gardner
  5.  
  6.  
  7.  
  8.   This month we would like to turn
  9.  
  10. your attention to us.  For one year
  11.  
  12. we have been publishing some very
  13.  
  14. useful routines that have received
  15.  
  16. little attention.  They form a major
  17.  
  18. portion of LOADSTAR's operating
  19.  
  20. system.  A great deal of what you see
  21.  
  22. in LOADSTAR is possible because of
  23.  
  24. some machine-language routines that
  25.  
  26. are contained in a ML program called
  27.  
  28. ROUTINES V4.
  29.  
  30.   ROUTINES V4 can be found on both
  31.  
  32. sides of this issue as well as many of
  33.  
  34. the past issues.  Very early issues
  35.  
  36. used an earlier version of ROUTINES.
  37.  
  38.   ROUTINES V4 is chock full of very
  39.  
  40. useful ML subroutines.  These include
  41.  
  42. routines for handling text windows,
  43.  
  44. 80 character input, modified listings,
  45.  
  46. and a user peek.  All of these will be
  47.  
  48. discussed in this article along with
  49.  
  50. examples of how to use each.
  51.  
  52.  
  53. TEXT WINDOWS
  54.  
  55.  A text window is a portion of the
  56.  
  57. screen in which text can be read and
  58.  
  59. scrolled, either up or down.  All of
  60.  
  61. the text in Paperless Pages, Influx,
  62.  
  63. Payload (in the files that describe
  64.  
  65. the programs) and  Contents Map is
  66.  
  67. viewed via a text window.
  68.  
  69.  A text window should be able to
  70.  
  71. scroll either up or down, providing
  72.  
  73. easy access to the reader.
  74.  
  75.  You will note that while you are
  76.  
  77. reading this article, you have the
  78.  
  79. capability of scrolling either up or
  80.  
  81. down using the function keys, cursor
  82.  
  83. keys, or joystick.  You will also
  84.  
  85. notice that the whole screen does NOT
  86.  
  87. scroll, only the text inside of the
  88.  
  89. window.  To keep things outside of the
  90.  
  91. window from scrolling, the window
  92.  
  93. handling routine must use boundaries.
  94.  
  95. In ROUTINES V4, these boundaries are
  96.  
  97. contained in memory locations 1020-
  98.  
  99. 1023.  The boundaries are defined as
  100.  
  101. follows:
  102.  
  103.      Top Boundary    -- 1020
  104.      Bottom Boundary -- 1021
  105.      Left Boundary   -- 1022
  106.      Right Boundary  -- 1023
  107.  
  108. The top and bottom boundaries can
  109.  
  110. range from 0 to 24.  The left and
  111.  
  112. right boundaries can range from 0 to
  113.  
  114. 39.  The left boundary MUST be less
  115.  
  116. than the right and the top boundary
  117.  
  118. MUST be less than the bottom.  To set
  119.  
  120. the boundaries of your text window,
  121.  
  122. simply POKE the values you want for
  123.  
  124. each boundary into the appropriate
  125.  
  126. memory location.  For example:
  127.  
  128.  
  129. 10 POKE 1020,5  :REM  _ top
  130. 20 POKE 1021,20 :REM  _ bottom
  131. 30 POKE 1022,10 :REM  _ left
  132. 40 POKE 1023,20 :REM  _ right
  133.  
  134.  
  135. Once the boundaries have been
  136.  
  137. established, you can begin displaying
  138.  
  139. text in the window.
  140.  
  141.   Now, you can start scrolling your
  142.  
  143. text.  Believe it or not, this is the
  144.  
  145. easy part because ROUTINES V4 does all
  146.  
  147. the work for you.
  148.  
  149.  
  150.  To scroll up   -- SYS 51206
  151.  To scroll down -- SYS 51209
  152.  
  153.  
  154. In addition to this, we must tell
  155.  
  156. ROUTINES what color to make the text. 
  157.  
  158. This is done with a POKE 646, X (where
  159.  
  160. X ranges between 0 and 15).  After
  161.  
  162. setting the color, a SYS 51203 will
  163.  
  164. set the color in the window.
  165.  
  166.   While displaying your text, you may
  167.  
  168. need to clear the entire window very
  169.  
  170. quickly without clearing the whole
  171.  
  172. screen.  No need to worry!  ROUTINES
  173.  
  174. V4 has a built-in 'clear window'
  175.  
  176. routine.
  177.  
  178.  
  179.  To clear a window  -- SYS 51200
  180.  
  181.  
  182. =======< continued in Part 31 >=======
  183.